<template>
    <div class="service_box">
        <div class="service_header">
            <div class="service_logo"></div>
            <span>本地服务</span>
            <el-button type="text" class="service_swith" @click="changeEvent('sever')" icon="el-icon-upload">协同模式</el-button>
        </div>
        <project ref="project" :onRefresh="getProjects" :onEdit="onEdit" :onCreat="onCreat" :onDelete="onDelete"></project>
    </div>
</template>
<script>
import project from './project';
export default {
    props: ['changeEvent', 'onCreat', 'onEdit', 'onDelete'],
    components: {
        project
    },
    mounted() {
        this.$nextTick(() => {
            this.getProjects();
        });
    },
    methods: {
        getProjects() {
            window.action.localProjects().then((res) => {
                this.$refs.project.setData(res);
            });
        },
    },
}
</script>